cmake_minimum_required(VERSION 3.16)

project(demo-lib VERSION 1.0.0 LANGUAGES CXX)

option(NOSAL_ENABLE_DOXYGEN "Enables the documentation target" OFF)

include(GNUInstallDirs)
include(NOSAL/nosal)
if(NOSAL_TARGET_MACHINE STREQUAL "QNX-SA8155")
    include(NOSAL/toolchain_qnx700_aarch64)
endif()

find_package(PkgConfig REQUIRED)

add_subdirectory(doc)
#add_subdirectory(src)

nosal_add_library(${PROJECT_NAME}
    SOURCES
        src/register.cpp
        src/context.cpp
    LIBS
    INCLUDES
        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
        $<INSTALL_INTERFACE:include>
    DEFINITIONS
    OPTIONS -Wno-noexcept-type
)

if(NOSAL_ENABLE_TESTS)
    message(STATUS "PROJECT MESSAGE: Demo Library tests are enabled")
    #enable_testing()
    add_subdirectory(test)
endif()

## Install header files
#install(
#    DIRECTORY include/
#    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
#    COMPONENT dev
#    FILES_MATCHING PATTERN "*.h"
#)

